import { http } from "@/utils/http";
import { baseUrlApi } from "@/store/utils";
//----------------------------------------收款管理----------------------------------------//
//获取收款管理列表
export const getreceivePaymentlist = (params?: object) => {
  return http.request("get", baseUrlApi("receivePayment/list"), { params });
};

//获取收款管理信息详情
export const getreceivePaymentinfo = (params?: object) => {
  return http.request("get", baseUrlApi("receivePayment/info"), { params });
};

//获取收款管理合同发票列表 新增
export const getreceivePaymentinvoice = (params?: object) => {
  return http.request("get", baseUrlApi("receivePayment/invoice"), { params });
};

//编辑-查看-获取合同收款发票
export const receivePaymentGetReceiveInvoice = (params?: object) => {
  return http.request("get", baseUrlApi("receivePayment/getReceiveInvoice"), {
    params
  });
};

//获取收款管理合同收款记录列表 新增
export const getreceivePaymenthistory = (params?: object) => {
  return http.request("get", baseUrlApi("receivePayment/history"), { params });
};

///编辑-查看-获取合同收款记录
export const getReceivehistory = (params?: object) => {
  return http.request("get", baseUrlApi("receivePayment/getReceivehistory"), {
    params
  });
};

//获取收款管理收款节点列表 编辑
export const getreceivePaymentnode = (params?: object) => {
  return http.request("get", baseUrlApi("receivePayment/node"), { params });
};

//收款详情编辑
export const receivePaymentSaveOrUpdate = (data?: object) => {
  return http.request("post", baseUrlApi("receivePayment/saveOrUpdate"), {
    data
  });
};

//加载收款节点下拉框列表（收款、付款 新增时的）
export const getcontractnodepaylist = (params?: object) => {
  return http.request("get", baseUrlApi("contract/node/pay/list"), { params });
};

//提交审批
export const submitApprovalApi = (data?: object) => {
  return http.request("post", baseUrlApi("receivePayment/submit/approval"), {
    data
  });
};

//删除审批
export const delApprovalApi = (data?: object) => {
  return http.request("post", baseUrlApi("receivePayment/deleteById"), {
    data
  });
};
//收款审批
export const receivePaymentApprovalApi = (data?: object) => {
  return http.request("post", baseUrlApi("receivePayment/approval"), { data });
};

//获取发票列表
export const getinvoicepage = (params?: object) => {
  return http.request("get", baseUrlApi("invoice/page"), { params });
};
//----------------------------------------付款管理----------------------------------------//
//付款审批
export const paymentApprovalApi = (data?: object) => {
  return http.request("post", baseUrlApi("payment/approval"), { data });
};
//付款删除
export const delPaymentApprovalApi = (data?: object) => {
  return http.request("post", baseUrlApi("payment/deleteById"), { data });
};
//付款删除
export const submitPaymentApprovalApi = (data?: object) => {
  return http.request("post", baseUrlApi("payment/submit/approval"), { data });
};
//付款详情编辑
export const paymentSaveOrUpdate = (data?: object) => {
  return http.request("post", baseUrlApi("payment/saveOrUpdate"), { data });
};
//获取付款管理列表
export const getpaymentlist = (params?: object) => {
  return http.request("get", baseUrlApi("payment/list"), { params });
};

//获取付款管理信息详情
export const getpaymentinfo = (params?: object) => {
  return http.request("get", baseUrlApi("payment/info"), { params });
};

//新增获取付款管理合同发票列表
export const getpaymentinvoice = (params?: object) => {
  return http.request("get", baseUrlApi("payment/invoice"), { params });
};

//新增获取付款管理合同发票列表
export const paymentgetReceiveInvoice = (params?: object) => {
  return http.request("get", baseUrlApi("payment/getReceiveInvoice"), {
    params
  });
};

//获取付款管理合同收款记录列表
export const getpaymenthistory = (params?: object) => {
  return http.request("get", baseUrlApi("payment/history"), { params });
};

//编辑的获取付款管理收款节点列表
export const getpaymentnode = (params?: object) => {
  return http.request("get", baseUrlApi("payment/node"), { params });
};

////---------------------------------------预收付款----------------------------------------//
//合同预收付款列表 0=销售合同 1=采购合同
export const getcontractpaymentpageList = (data?: object) => {
  return http.request("post", baseUrlApi("contract/payment/pageList"), {
    data
  });
};
//订单预收付款列表 0=项目订单 1=供货订单
export const getprepaymentpageList = (data?: object) => {
  return http.request("post", baseUrlApi("pre/payment/pageList"), {
    data
  });
};
//合同收付款完成 0=销售合同 1=采购合同
export const getcontractpaymentfinishPayment = (data?: object) => {
  return http.request("post", baseUrlApi("contract/payment/finishPayment"), {
    data
  });
};
//订单收付款完成 0=项目订单 1=供货订单
export const getprepaymentfinishPayment = (data?: object) => {
  return http.request("post", baseUrlApi("pre/payment/finishPayment"), {
    data
  });
};
//收据接口
export const getreceiptsaveOrUpd = (data?: object) => {
  return http.request("post", baseUrlApi("receipt/saveOrUpd"), {
    data
  });
};
//合同详情
export const getcontractpaymentfindByIdInfo = (params?: object) => {
  return http.request("get", baseUrlApi("contract/payment/findByIdInfo"), {
    params
  });
};
//订单详情
export const getprepaymentfindByIdInfo = (params?: object) => {
  return http.request("get", baseUrlApi("pre/payment/findByIdInfo"), {
    params
  });
};
//收据说明
export const getreceiptdetail = (params?: object) => {
  return http.request("get", baseUrlApi("receipt/detail"), {
    params
  });
};
//合同付款记录
export const getpaymenthistorypageList = (data?: object) => {
  return http.request("post", baseUrlApi("payment/history/pageList"), {
    data
  });
};

//供货订单列表
export const getpoprepaymentpageList = (data?: object) => {
  return http.request("post", baseUrlApi("po/pre/payment/pageList"), {
    data
  });
};

//供货订单详情
export const getpoprepaymentfindByIdInfo = (params?: object) => {
  return http.request("get", baseUrlApi("po/pre/payment/findByIdInfo"), {
    params
  });
};

//供货订单付款完成
export const getpoprepaymentfinishPayment = (params?: object) => {
  return http.request("get", baseUrlApi("po/pre/payment/finishPayment"), {
    params
  });
};
